<%--
  Created by IntelliJ IDEA.
  User: HP
  Date: 2021-3-6
  Time: 13:01
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%--useBean类属性[com.hll.Person]的值无效
    java类属性必须私有, 必须有无参构造函数（经常忘），必须有public的get和set
--%>
<jsp:useBean id="p1" class="com.hll.Person" scope="page"/>
<jsp:setProperty name="p1" property="name" value="hll"/>
<jsp:setProperty name="p1" property="age" value="21"/>
<jsp:setProperty name="p1" property="id" value="1"/>

姓名:
<jsp:getProperty name="p1" property="name"/>
年龄:
<jsp:getProperty name="p1" property="age"/>

</body>
</html>
